/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-01 10:19:06
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\other\uiCascader.js
 * @CIMC-V2
 */
import { exExpandTriggerSelect, exInput, exSwitch, exValidateSelect, exRequestData } from '@ve/common/components/extension'
// exSwitch,
export default {
  VERSION: '20220408',
  type: 'chartCascader',
  name: '级联选择',
  icon: 'menu-unfold-line',
  data: {
    requestData: {},
    formData: {},
  },
  //数据别名
  // dataName: 'uiCascader_data',
  //扩展
  extension: {
    model: exInput('Model', 'cascader_name'),
    extendRule: exValidateSelect('', {}, []),
    api: exInput('Api接口', ''),
    method: exInput('Method', ''),
    getDataKey: exInput('获取数据Key', ''),
    requestData: exRequestData('参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
    ]),
    subKey: exInput('提交值', 'cascader_name'),
    levelKey: exInput('PIDkey', ''),
    superiorKey: exInput('上级key', ''),
    sublevelApi: exInput('子级Api接口', ''),
    sublevelMethod: exInput('子级Method', ''),
    sublevelGetDataKey: exInput('子级获取数据Key', ''),
    sublevelRequestData: exRequestData('子级参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
    ]),
    sublevelKey: exInput('需要上级key', 'key'),
    sublevelLabelField: exInput('子级label字段', 'label'),
    sublevelValueField: exInput('子级value字段', 'value'),
    subleveSsubKey: exInput('子级提交值', 'cascader_name'),
    label: exInput('标签', '级联选择'),
    labelField: exInput('label字段', 'label'),
    valueField: exInput('value字段', 'value'),
    childrenField: exInput('children', 'children'),
    width: exInput('宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    labelWidth: exInput('label宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    optionConfig: {
      type: 'exCascaderOptionConfig',
      name: '选项配置',
      value: [],
    },
    showLastLevel: exSwitch('显示最后一级', true),
    allLevelKey: exInput('级别Key', ''),
    expandTrigger: exExpandTriggerSelect('展开方式', 'click'),
    multiple: exSwitch('可多选', false),
    checkStrictly: exSwitch('可选任一级', false),
    filterable: exSwitch('可搜索', false),
    disabled: exSwitch('禁用', false),
    hidden: exSwitch('隐藏', false),
    dontRequest: exSwitch('默认不请求', false),
    lastLevel: exSwitch('获取最后一级', false),
    defaultValue: exInput('默认值', ''),
  },
  //数据源绑定
  dataSourceBind: {
    sourceId: {
      type: 'exGetDataSource',
      name: '组件ID',
      value: {
        type: 1,
        source: [],
      },
    },
    // dataKey: exInput('数据Key', ''),
    getDataKey: exInput('数据Key', '', '获取数据的 key 的集合，多个 key 用 “,” 分隔，如需获取全部数据则不填写'),
    hasParam: exSwitch('当参数用', false, '默认当数据使用,开启当参数使用'),
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
